<%--&lt;%&ndash;--%>
<%--  Created by IntelliJ IDEA.--%>
<%--  User: lenovo--%>
<%--  Date: 2024/12/17--%>
<%--  Time: 16:03--%>
<%--  To change this template use File | Settings | File Templates.--%>
<%--&ndash;%&gt;--%>
<%--<%@ page contentType="text/html;charset=UTF-8" language="java" %>--%>
<%--<html>--%>
<%--<head>--%>
<%--    <title>Title</title>--%>
<%--    <style>--%>
<%--        #content{--%>
<%--            width: 100%;--%>
<%--            height: 520px;--%>
<%--            margin-right: 40px;--%>
<%--            border: saddlebrown 1px solid;--%>
<%--        }--%>
<%--        #innerAddTaskFrame{--%>
<%--            width: 100%;--%>
<%--            height: 380px;--%>
<%--            margin-left: 50px;--%>
<%--            color: mediumslateblue;--%>
<%--            font-family: cursive;--%>
<%--            margin-top: 50px;--%>
<%--            font-size: 22px;--%>
<%--            border: saddlebrown 1px solid;--%>
<%--        }--%>
<%--    </style>--%>
<%--</head>--%>
<%--<body>--%>
<%--<div id="content">--%>

<%--    <div id="innerAddTaskFrame">--%>
<%--        &nbsp;&nbsp;&nbsp;请作答：<br>--%>
<%--        <form action="student.action?action=dealAnswer&taskAccount=${taskAccount}" method="post" onsubmit="return isDeal()">--%>
<%--            <textarea id="answer" style="width: 600px;height: 240px;font-family: cursive;font-size: 18px" rows="4" name="answer">--%>

<%--            </textarea>--%>
<%--            <br> <br> <br>--%>
<%--            <input style="margin-left: 350px;font-family: cursive;font-size: 18px" type="submit" value="点击添加">--%>

<%--        </form>--%>
<%--        <span style="margin-left: 320px;font-size: 15px;color: red">${tip}</span>--%>


<%--    </div>--%>

<%--</div>--%>


<%--</body>--%>
<%--</html>--%>
<%--<script>--%>
<%--    function isDeal(){--%>
<%--        let text = document.getElementById("answer").value;--%>
<%--        if(text.trim()==null){--%>
<%--            alert("答案不能为空");--%>
<%--            return false;--%>
<%--        } else {--%>
<%--            return true;--%>
<%--        }--%>
<%--    }--%>
<%--</script>--%>





<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2024/12/17
  Time: 16:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>作答页面</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f0f8ff; /* 淡蓝色背景 */
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
        }

        .container {
            background-color: #ffffff; /* 白色背景 */
            padding: 20px;
            border-radius: 10px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            width: 500px; /* 固定宽度 */
            box-sizing: border-box;
        }

        .answer-section {
            text-align: center;
            padding: 20px;
        }

        .answer-section h2 {
            color: #333333;
        }

        .input-field {
            width: 100%;
            height: 150px;
            padding: 10px;
            margin-top: 20px;
            border: 2px solid #007bff; /* 蓝色边框 */
            border-radius: 5px;
            font-size: 16px;
            font-family: inherit;
            resize: none; /* 禁止调整大小 */
            outline: none; /* 去除聚焦时的边框 */
        }

        .input-field:focus {
            border-color: #0056b3; /* 聚焦时边框颜色变深 */
        }

        .submit-button {
            background-color: #28a745; /* 绿色背景 */
            color: white;
            border: none;
            padding: 10px 20px;
            font-size: 16px;
            font-family: inherit;
            border-radius: 5px;
            cursor: pointer;
            margin-top: 20px;
            transition: background-color 0.3s;
        }

        .submit-button:hover {
            background-color: #218838; /* 鼠标悬停时背景颜色变深 */
        }

        .tip {
            margin-top: 10px;
            font-size: 14px;
            color: red;
        }
    </style>
<%--    <link rel="stylesheet" href="styles.css"> <!-- 引入外部CSS文件 -->--%>
</head>
<body>
<div class="container">
    <div class="answer-section">
        <h2>请作答：</h2>
        <form action="student.action?action=dealAnswer&taskAccount=${taskAccount}" method="post" onsubmit="return isDeal()">
            <textarea id="answer" class="input-field" name="answer" placeholder="在这里输入你的答案..."></textarea>
            <br>
            <button type="submit" class="submit-button">点击添加</button>
        </form>
        <div class="tip" style="color: red;">${tip}</div>
    </div>
</div>

<script>
    function isDeal() {
        let text = document.getElementById("answer").value;
        if (text.trim() === "") {
            alert("答案不能为空");
            return false;
        } else {
            return true;
        }
    }
</script>
</body>
</html>